package org.yonggan.dmp.utils

object RichString {

  implicit  def string2RichString (str:String)  = new RichString(str)

}


class RichString (str:String) {

  def toIntx: Int = {
    try {
      str.toInt
    } catch {
      case _: Exception => 0
    }

  }

  def toDoublex: Double = {
    try {
      str.toDouble
    } catch {
      case _: Exception => 0.0
    }
  }

}

